.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2021 The FreeBSD Foundation
.\"
.\" This manual page was written by Ka Ho Ng under sponsorship from
.\" the FreeBSD Foundation.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd April 24, 2022
.Dt VNODE_PAGER_PURGE_RANGE 9
.Os
.Sh NAME
.Nm vnode_pager_purge_range
.Nd "invalidate the cached content within the given byte range"
.Sh SYNOPSIS
.In sys/param.h
.In vm/vm.h
.In vm/vm_extern.h
.Ft void
.Fo vnode_pager_purge_range
.Fa "struct vnode *vp"
.Fa "vm_ooffset_t start"
.Fa "vm_ooffset_t end"
.Fc
.Sh DESCRIPTION
.Nm
invalidates the cached content within the given byte range from the
specified vnode
.Fa vp .
The range to be purged is
.Eo [
.Fa start , end
.Ec ) .
If the
.Fa end
parameter is the value zero, the affected range starts from
.Fa start
continues to the end of the object.
Pages within the specified range will be removed from the object's queue.
If
.Fa start
or
.Fa end
is not aligned to a page boundary, the invalidated part of the page is zeroed.
This function only cleans the resident pages in the affected region, it is up to
the callers to ensure reading the backing store gets back zeroes.
.Pp
In case the vnode
.Fa vp
does not have a VM object allocated, the effect of calling this function is a
no-op.
.Sh LOCKS
The vnode must be locked on entry and will still be locked on exit.
.Sh SEE ALSO
.Xr vnode 9
.Sh HISTORY
The
.Nm
manual page first appeared in
.Fx 14 .
.Sh AUTHORS
This
manual page was written by
.An Ka Ho Ng Aq Mt khng@FreeBSD.org .
